summation django queryset

267

summation django queryset -

from django.db.models import Sum

ItemPrice.objects.aggregate(Sum('price'))
# returns {'price__sum': 1000} for example

Comments

Submit
0 Comments